<template>

  <div class="main-wrapper">
    <div class="content-wrapper" v-if="userSearchResult.length !== 0">
      <div class="title">用户</div>
      <div>共找到{{userSearchResult.length}}条结果</div>
      <GridLayout :items="userSearchResult" :gutter="0" :span="24">
        <template #item="{ ele }">
          <user-ele :data />
        </template>
      </GridLayout>
<!--      <el-divider />-->
    </div>

    <div class="content-wrapper" v-if="postSearchResult.length !== 0">
      <div class="title">动态</div>
      <div>共找到{{postSearchResult.length}}条结果</div>
      <GridLayout :items="postSearchResult" :gutter="0" :span="24">
        <template #item="{ ele }">
          <post-ele :data />
        </template>
      </GridLayout>
      <el-divider>再怎么找也没有了</el-divider>
    </div>
    <div v-else>
      <div>没有找到相关动态</div>
    </div>
  </div>

</template>

<script>
import UserEle from "@/views/SearchView/UserEle.vue"
import PostEle from "@/views/SearchView/PostEle.vue";
import GridLayout from "@/components/GridLayout.vue";
export default {
  name: "SearchView",
  components: {
    GridLayout,
    UserEle,
    PostEle,
  },
  created() {
    // this.$route.query.obj
    // this.$route.query.word
  },
  data() {
    return {
      userSearchResult: Array(3),
      postSearchResult: Array(14),
    };
  },
  methods: {

  }
}
</script>

<style scoped>

.main-wrapper {
  background-color: var(--color-light);
  /*background-color: red;*/
  padding: 30px;
  display: flex;
  /*width: 100%;*/
  flex-direction: column;
  align-items: center;
  .content-wrapper {
    margin-bottom: 30px;
    width: 800px;
    background-color: white;
    padding: 10px 20px 20px 20px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    .title {
      font-weight: bold;
      font-size: var(--font-size-large);
    }
  }
}
</style>